<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function f1() {
      setTimeout(() => {
        console.log('f1 3秒后执行');
        iterator.next()
      }, 3000);

    }
    function f2() {
      setTimeout(() => {
        console.log('f2 4秒后执行');
        iterator.next()
      }, 4000);

    }
    function f3() {
      setTimeout(() => {
        console.log('f3 5秒后执行');
      }, 5000);
    }
    function* show() {
      yield f1()
      yield f2()
      yield f3()
    }
    console.log(show);
    let iterator = show()
    console.log(iterator);
    iterator.next()
  </script>
</body>

</html>